var n;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.EventMgr = undefined;
var LogManager = require("AA_LogManager");
var SingletonManager = require("AA_SingletonManager");
var c = function (e) {
  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    t._target = new cc.EventTarget();
    return t;
  }
  __extends(t, e);
  t.prototype.addEventListener = function (e, t, o) {
    if (e) {
      if (null == t) {
        LogManager.LogMgr.warn("addEventListener callBack is nil");
        return false;
      } else {
        this._target.on(e, t, o);
        return true;
      }
    } else {
      LogManager.LogMgr.warn("eventName is empty" + e);
      return false;
    }
  };
  t.prototype.addEventListenerOnce = function (e, t, o) {
    if (e) {
      if (null == t) {
        LogManager.LogMgr.warn("addEventListener callBack is nil");
        return false;
      } else {
        this._target.once(e, t, o);
        return true;
      }
    } else {
      LogManager.LogMgr.warn("eventName is empty" + e);
      return false;
    }
  };
  t.prototype.cleanEventListener = function () {
    this._target.clear();
    return true;
  };
  t.prototype.rmEventListener = function (e, t, o) {
    this._target.off(e, t, o);
  };
  t.prototype.dispatchEvent = function (e) {
    var t;
    var o = [];
    for (var n = 1; n < arguments.length; n++) {
      o[n - 1] = arguments[n];
    }
    (t = this._target).emit.apply(t, __spreadArrays([e], o));
  };
  return t;
}(SingletonManager.SingletonMgr);
exports.EventMgr = c.getInstance();